package com.aluvfy.bank.dao;

import com.aluvfy.bank.pojo.Account;
import com.aluvfy.bank.utils.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * @author: aluvfy
 * @description:
 * @date: 2024/11/21 22:31
 */
public class AccountDaoImp implements AccountDao{

    @Override
    public Account selectByActno(String actno) {
        SqlSession sqlSession = SqlSessionUtil.openSession();
        Account account  = (Account) sqlSession.selectOne("account.selectByActno", actno);
//        sqlSession.close();
        return account;
    }

    @Override
    public int updateByActno(Account act) {
        SqlSession sqlSession = SqlSessionUtil.openSession();
        int count = sqlSession.update("account.updateByActno", act);
//        sqlSession.commit();
//        sqlSession.close();
        return count;
    }
}
